package com.javarj.secure_file;

import cn.hutool.core.io.FileUtil;

public class Main {

	public static void main(String[] args) {
		Integer[] num = { 103, 77, 222, 246, 70, 150, 128, 235, 32, 152, 241, 64, 47, 33, 102, 93, 43, 35, 240, 2, 166,
				230, 23, 115, 125, 164, 177, 61, 236, 248, 233, 96, 209, 24, 151, 106, 69, 223, 83, 219, 25, 3, 53, 11,
				154, 44, 20, 142, 176, 48, 181, 84, 196, 185, 168, 188, 98, 60, 191, 135, 12, 183, 92, 59, 90, 194, 101,
				132, 45, 255, 140, 173, 88, 8, 167, 170, 192, 40, 19, 226, 105, 193, 214, 153, 41, 211, 100, 18, 108,
				110, 250, 73, 87, 180, 171, 162, 204, 161, 243, 10, 99, 94, 205, 13, 198, 138, 79, 178, 160, 237, 22,
				56, 126, 14, 220, 232, 184, 229, 195, 182, 7, 200, 28, 80, 65, 187, 227, 97, 31, 52, 49, 107, 147, 159,
				9, 86, 199, 89, 155, 239, 210, 157, 39, 46, 30, 190, 186, 247, 26, 143, 133, 253, 111, 36, 141, 37, 81,
				6, 91, 17, 145, 51, 201, 131, 5, 4, 242, 208, 179, 58, 197, 252, 234, 174, 27, 127, 225, 139, 42, 217,
				203, 68, 213, 238, 175, 169, 76, 134, 85, 38, 137, 112, 244, 144, 224, 78, 54, 218, 123, 206, 124, 158,
				216, 118, 15, 67, 245, 75, 34, 1, 165, 212, 130, 251, 113, 66, 221, 0, 72, 82, 109, 156, 129, 21, 74,
				104, 202, 231, 136, 95, 148, 149, 120, 146, 55, 215, 172, 119, 117, 16, 122, 29, 121, 50, 63, 189, 71,
				228, 254, 62, 163, 249, 116, 57, 207, 114 };
		Integer[] num2 = { 217, 209, 19, 41, 165, 164, 157, 120, 73, 134, 99, 43, 60, 103, 113, 204, 239, 159, 87, 78,
				46, 223, 110, 22, 33, 40, 148, 174, 122, 241, 144, 128, 8, 13, 208, 17, 153, 155, 189, 142, 77, 84, 178,
				16, 45, 68, 143, 12, 49, 130, 243, 161, 129, 42, 196, 234, 111, 253, 169, 63, 57, 27, 249, 244, 11, 124,
				215, 205, 181, 36, 4, 246, 218, 91, 224, 207, 186, 1, 195, 106, 123, 156, 219, 38, 51, 188, 135, 92, 72,
				137, 64, 158, 62, 15, 101, 229, 31, 127, 56, 100, 86, 66, 14, 0, 225, 80, 35, 131, 88, 220, 89, 152,
				191, 214, 255, 23, 252, 238, 203, 237, 232, 242, 240, 198, 200, 24, 112, 175, 6, 222, 212, 163, 67, 150,
				187, 59, 228, 190, 105, 177, 70, 154, 47, 149, 193, 160, 233, 132, 230, 231, 5, 34, 9, 83, 44, 138, 221,
				141, 201, 133, 108, 97, 95, 250, 25, 210, 20, 74, 54, 185, 75, 94, 236, 71, 173, 184, 48, 26, 107, 168,
				93, 50, 119, 61, 116, 53, 146, 125, 55, 245, 145, 58, 76, 81, 65, 118, 52, 170, 104, 136, 121, 162, 226,
				180, 96, 102, 199, 254, 167, 32, 140, 85, 211, 182, 82, 235, 202, 179, 197, 39, 114, 216, 2, 37, 194,
				176, 79, 126, 247, 117, 21, 227, 115, 30, 172, 7, 28, 109, 183, 139, 18, 10, 166, 98, 192, 206, 3, 147,
				29, 251, 90, 213, 171, 151, 248, 69 };
		String old = "C:\\Users\\Administrator\\Desktop\\aa.png";
		if(args.length > 0) {
			old = args[0];
		}
		old = old.replace("\\", "/");
		byte[] readBytes = FileUtil.readBytes(old);
		String min = old + ".aaa";
		byte[] readBytes2 = SecureServiceUtil.encry(readBytes, num);
		FileUtil.writeBytes(readBytes2, min);
//		byte[] readBytes3 = SecureServiceUtil.decry(readBytes2, num2);
//		String dest = "C:\\Users\\Administrator\\Desktop\\cc.png";
//		FileUtil.writeBytes(readBytes3, dest);

	}
}
